import React, { useState } from "react"
import { Link } from "umi"
import { useLocation, useHistory } from "react-router"
import { Table, Button, Input, Pagination, Modal, Radio } from "antd"

import styles from "./commonModal.less"

interface IProps {
  title?: string,// 标题
  show: boolean, // 是否显示弹框
  setShow: Function // 父组件 设置是否隐藏函数
  getChildParam?: Function // 点击确认的 获取子组件参数
  requestAsync?: (...args: any[]) => Promise<any>, // 传接口
  children?: React.ReactNode
}

const commonModal: React.FC<IProps> = (props) => {
  console.log(111, props)
  let [newHospitalModal, setNewHospitalModal] = useState<boolean>(true)


  const newHospitalModalEvent = () => {
    setNewHospitalModal(true)
  }

  // 点击取消 
  const handleCancel = () => {
    setNewHospitalModal(false)
  }



  return (
    <div className={styles.commonModal} >
      <Modal getContainer={false} title={props.title} centered width={420} visible={props.show} onCancel={handleCancel} footer={null} >
        {props.children}
      </Modal>

    </div >
  )
}

export default commonModal
